﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>标题</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="关键字" />
<meta name="description" content="关键字描述" />
<link href="main.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="JS文件路径"></script>

<script type="text/javascript">
/*此处为JS代码*/
</script>
<!-- 以下为CSS代码
<style type="text/css">
/*  hr {color: sienna;}
 * p {margin-left: 20px;}
 * body {background-image: url("");}
*/
</style>
-->
</head>
<body>
	---
	<script type="text/javascript">

function ajaxFunction()
 {
 var xmlHttp;
 
 try
    {
   // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
 catch (e)
    {

  // Internet Explorer
   try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
   catch (e)
      {

      try
         {
         xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
         }
      catch (e)
         {
         alert("您的浏览器不支持AJAX！");
         return false;
         }
      }
    }
	
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
         document.myForm.time.value=xmlHttp.responseText;
        }
      }
    xmlHttp.open("GET","time.php",true);
    xmlHttp.send(null);
	
 }


</script>

	<form name="myForm">
		用户: <input type="text" name="username" onkeyup="ajaxFunction();" />
		时间: <input type="text" name="time" id="pp5" />
		<script type="text/javascript">
function ttt()
 {
 tt=document.myForm.time.value="1111121212121";
}
wertwe=setTimeout("ttt()",1000);
</script>
		<span id="pp">3</span>
	</form>

	---

</body>
</html>